<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOperationLogsTable extends Migration
{
    /**
     * Run the migrations.
     * 操作日志
     * @return void
     */
    public function up()
    {
        Schema::create('operation_logs', function (Blueprint $table) {
            $table->increments('id');
            $table->string('operator')->comment('操作者')->nullable();
            $table->dateTimeTz('operator_time')->comment('操作时间')->nullable();
            $table->ipAddress('ip')->comment('IP地址')->nullable();
            $table->text('record')->comment('操作记录')->nullable();
            $table->string('method')->comment('操作方法')->nullable();
            $table->string('route')->comment('路由')->nullable();
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('operation_logs');
    }
}
